//index.js
//获取应用实例
const app = getApp()
const config = require('../../utils/config.js')
Page({
  data: {
    express: []
  },
  onLoad: function(data) {
    console.log(data)
    if (data.superior != null && data.superior != '') {
      wx.setStorageSync("superior", data.superior)
    }
    this._getExpress()
  },
  _getExpress() {
    let _this = this;
    wx.request({
      url: config.HOST + '/express/list',
      success(res) {
        console.log("快递公司")
        console.log(res)
        _this.setData({
          express: res.data
        })
      }
    })
  },
  // 选择快递公司完成，进入快递详细填写页码
  requestSkd(event) {
    // console.log(this.data.express[event.currentTarget.dataset.index])
    // 选择的快递公司
    app.globalData.chooseExpress = this.data.express[event.currentTarget.dataset.index]
    wx.navigateTo({
      url: '../request/index',
    })
  }
})